﻿using FluentValidation;
using Turquoise.Entities.Complex.BaseModels;
using Turquoise.Entities.Data;
using Turquoise.Globalization;

namespace Turquoise.Validation.FluentValidation.ContentTypeValidation
{
    public class UpdateRules : AbstractValidator<UpdateModel<ContentType>>
    {
        public UpdateRules()
        {
            RuleFor(p => p.Item.ContentTypeLanguageLines[0].ContentTypeName).NotEmpty().WithMessage(Resources.NameNotEmpty);
            RuleFor(p => p.Item.ContentTypeLanguageLines[0].ContentTypeName).Length(2, 100).WithMessage(Resources.NameLength);
        }
    }
}
